Use of nonlinear pulsed magnetic fields for spatial encoding in magnetic resonance imaging

This study examines the use of nonlinear magnetic field coils for spatial encoding in magnetic resonance imaging. Existing theories on imaging with such coils share a complex reconstruction process that originates from a suboptimal signal interpretation in the spatial-frequency domain (k-space). In this study, a new solution to this problem is proposed, namely a two-step reconstruction process, in which in the first step, the image signal is converted into a frequency spectrum, and in the second step, the spectrum, which represents the distorted image, is geometrically and intensity corrected to obtain an undistorted image. This theory has been verified by numerical simulations and experimentally using a straight wire as a coil model for an extremely nonlinear magnetic field. The results of this study facilitate the use of simple encoding coil designs that can feature low inductance, allowing for much faster switching times and higher magnetic field gradients.

www.nature.com/scientificreports/concept of local k-space also provides a theoretical basis for performing spatial localization by using nonlinear magnetic fields 22 and for trajectory optimization in imaging 23 .
Applications of imaging with nonlinear magnetic field coils include faster sensitivity calibration of RF coils 24 , resolving iso-sensitivity issues in RF coils 25 , design of a monoplanar gradient system with such fields as an insert for a clinical scanner 26 .The possibility of using nonlinear magnetic field coils as a complement to conventional gradient coils was also investigated to obtain focused imaging in selected sample regions 17,27,28 .In the FRONSAC method, such coils were used to improve the encoding efficiency of standard linear gradient trajectories by adding a rapidly rotating nonlinear spatial encoding magnetic field of moderate amplitude 29,30 .Other applications of these coils in MRI include tailored region [31][32][33] or slice 34,35 excitation, organ-targeted diffusion measurements 36,37 , and improved correction of B 1 + inhomogeneity 38 .In addition, the effects of nonlinear magnetic fields in DTI have been studied 39 and efficient methods for their mapping have been developed 40 .
In this study, we propose an alternative method of magnetic resonance imaging with nonlinear magnetic fields, which includes the following rules.First, the number of encoding fields is equal to the dimensionality of the image.Second, the transformation of the object's coordinates into the corresponding magnetic fields, i.e. in NMR frequencies, is bijective.Third, the acquired image signal is a function of time, actual time in the first dimension and pseudo time in higher dimensions.Fourth, the image reconstruction is a two-step process in which in the first step the time-domain image signal is transformed into a multidimensional spectrum, i.e. into a distorted image of the object, and in the second step the final image is reconstructed from this spectrum using a frequency-to-space transformation for geometric corrections and a Jacobian determinant for intensity corrections.The presented method was first verified with simulations, and then with experiments on a test and biological sample.

Theory Time-domain signal and its spectrum in two dimensions
Most commonly used MR imaging techniques rely on Fourier imaging principles that were first proposed by Kumar et al. already in 1975 6 .In this approach MR image is considered as a special type of multidimensional NMR spectrum.For the sake of simplicity let us consider this in two-dimensions (2D) so that the spectrum Ŝ(ω 1 , ω 2 ) and its corresponding time-domain signal S(t 1 , t 2 ) are related by 2D Fourier transformation and its inverse MR imaging using linear pulsed magnetic fields MR imaging was made possible by the introduction of magnetic field gradients ⇀ G that introduce a linear relation between the spatial coordinate ⇀ r and the frequency shift �ω , i.e. �ω = γ ⇀ G • ⇀ r , where γ is the gyromagnetic ratio.Magnetic field gradients are applied in pulses with precise amplitudes and timings that are controlled by the NMR spectrometer executing a pulse sequence.In a standard spin-echo sequence (Fig. 1), the signal is acquired during a readout gradient pulse G r , while the phase-encoding gradient G p is applied in a pulse of duration t p prior to the acquisition and of which amplitude is progressively increasing between repetitions of the sequence.Directions of these two gradients are perpendicular, e.g.G r in the x-direction and G p in the y-direction.For these two gradients, the frequency-time product (phase) can be replaced by the spatial-frequency-space product (1) Spin-echo imaging pulse sequence.This pulse sequence was used to test the feasibility of imaging with nonlinear magnetic field coils.
Introducing k-space (spatial frequency), which is proportional to gradient-time product, can be considered as a substitution for time and similarly can space be considered as a substitution for frequency, while preserving the form of transformation equations Eqs.(1, 2).Moreover, these substitutions give new meaning to the NMR spectrum Ŝ(ω 1 , ω 2 ) and to the time-domain signal S(t 1 , t 2 ) ; the latter is converted to a spatial-frequency-domain signal and the former to an MR image Equations ( 4) and ( 5) are the fundamental equations for all Fourier-based MR imaging techniques.They explain the acquired MR signals and provide a recipe for image reconstruction from the acquired signals.

MR imaging using nonlinear pulsed magnetic fields
What if, instead of the conventional gradient coils that produce spatially linear magnetic fields B z with a constant gradient ⇀ G = ∇B z , another type of "gradient" coils is used, namely such that produce spatially nonlinear magnetic fields.In this case, the k-space concept in Eq. ( 3) fails, as does the reconstruction principle given by Eq. ( 5).This is because, for such magnetic fields, the gradient ∇B z varies in space, so it is not possible to have a uniform k-space coordinate (same spatial frequency) over the entire area of the sample.In this case ⇀ r and ⇀ k are not independent ( ⇀ k is a function of ⇀ r ) so they do not form a pair of Fourier transform conjugated variables.However, this does not affect the frequency-time concept in Eqs.(1, 2).This still applies to spatial-encoded signals obtained with such coils and can be used as an essential step in image reconstruction from these signals.
Let us consider a case where the readout gradient coil is replaced by a coil that produces a spatially variable magnetic field B 1 (x, y, I r ) at the readout coil current I r and the phase-encoding gradient coil is replaced by a coil with a magnetic field B 2 (x, y, I p ) at the phase-encoding current I p .These two coils are used with the same imaging sequence as before, i.e. the spin-echo sequence in Fig. 1.With the use of these coils, the following nuclei frequency and time variables can be defined Here, t p is the duration of the phase-encoding current pulse.Note that frequency-time product ω 2 t 2 = γ B 2 (x, y, I p ) t p can be due to the proportionality of magnetic field to current transformed to γ B 2 (x, y, I r ) t p I p /I r from where follows the relation in Eq. ( 6).The frequency-encoding principle is used in the first frequency (former spatial x) direction so that the signal is acquired with the readout coil on and time t 1 corresponds to the actual time t measured from the point of gradient echo formation.This also coincides with the spin-echo point and lies in the center of the readout pulse (Fig. 1).Phase-encoding principle is used in the second frequency (former spatial y) direction so that the phase-encoding current pulse is executed before the readout period.In addition, there is no actual time that would correspond to time t 2 .Instead, t 2 is a pseudo time that corresponds to the ratio between phase and readout currents multiplied by the duration of the phaseencoding current pulse (Supplementary Eq. ( S3)).It is also important that the frequency ω 2 depends only on the position and not on the phase current I p , while the readout current I r is constant in the experiment and can be considered as the reference current.
Knowing the relation between the frequency and position (Eq.6) for coils with nonlinear spatial magnetic field enables the calculation of the corresponding MR signal for any distribution ρ(x, y) of detected nuclei Here, the integral range parameters X 1 , X 2 and Y 1 , Y 2 span the entire sample area or more, so that the result of the integral is no different as if the integral range were from − ∞ to + ∞ .The Eq. ( 7) is a combination of signals in time-domain Eq. ( 1) and spatial-frequency-domain Eq. ( 4).From the first, it has the frequency-time dependence of the transformation, and from the second, integration over space.In its current form, Eq. ( 7) cannot be considered as a Fourier transform since the frequency is a function of the integration variable, i.e. space.To make it a Fourier transform, the integration over space must be replaced by integration over frequency, which can be done by integration by substitution (3) The substitution from spatial to frequency coordinates in Eq. ( 8) can only be performed if the transformation is bijective and therefore invertible, i.e.where each element (ω 1 , ω 2 ) of the frequency-domain is paired with exactly one element (x, y) of the spatial-domain and vice versa.Only in this case transformation (x, y) → (ω 1 , ω 2 ) has its inverse (ω 1 , ω 2 ) → (x, y) (Supplementary Fig. S1).Comparison between Eqs. (1) and (8) shows that the spectrum Ŝ(ω 1 , ω 2 ) is the following function of the MR image ρ(x, y) Here, the determinant on the right-hand side of the equation is known as the Jacobian determinant.According to the inverse function theorem 41 , this determinant must be nonzero and the transformation function continuously differentiable within the sample region for the transformation to be bijective (reversable).The Eq. ( 9) also enables image reconstruction in two steps.In the first step, the spectrum Ŝ(ω 1 , ω 2 ) is calculated from the time-domain signal S(t 1 , t 2 ) using Eq. ( 2) and in the second step the image ρ(x, y) is calculated from the spectrum Ŝ(ω 1 , ω 2 ) using modified Eq. (9)   In Eq. (10), the reciprocal relation between the Jacobian determinants of the transformation (x, y) → (ω 1 , ω 2 ) and its inverse (ω 1 , ω 2 ) → (x, y) was used

Imaging sequence parameter setting for MRI using coils with nonlinear magnetic fields
Of the two spatial encoding coils used for 2D imaging with the spin-echo sequence (Fig. 1), coil 1 is used as the frequency encoding coil, so that the readout current I r during pulses through coil 1 is constant in the sequence, while coil 2 is used as a phase encoding coil and the current I p during pulses through coil 2 increases from − M 2 I p to ( M 2 − 1)�I p in steps of I p in M phase encoding steps of the sequence.The first step in setting the imaging parameters is to select the acquisition frequency bandwidth BW 1 for the read dimension and then adjust the readout current I r for coil 1 .BW 1 must be greater than or equal to the frequency width �ω 1 of the sample signal in the magnetic field of coil 1 , i.e., BW 1 ≥ �ω 1 .When I r is set, it is possible to determine the frequency width �ω 2 of the sample signal in the magnetic field of coil 2 and also BW 2 by satisfying the condition BW 2 ≥ �ω 2 .If these conditions are not met for BWs, signal aliasing occurs, causing the wrap around artifact.From known BWs, signal acquisition dwell time parameters can be then determined for both dimensions as �t 1 = 1/BW 1 and �t 2 = 1/BW 2 .The latter parameter can be then used to calculate the increment of the phase current for coil 2 using Eq. ( 6) �I p = I r �t 2 /t p .

Results
The feasibility of imaging with nonlinear magnetic field gradient coils was simulated using the infinite straight wire model for two different objects selected as the test model.The simulation results are shown in Fig. 2A for the object with "ab" characters and in Fig. 2B for the checkerboard object.In the simulation, the corresponding spectrum (b) was calculated from the object (a) using Eq. ( 13) and then the object's image (c) was reconstructed from it using Eq. ( 14).To simulate the effect of noise on the reconstructed image, Rician noise was added to the noise-free spectrum to obtain a noisy spectrum (d), from which an object's noisy image (e) was then reconstructed.The simulation parameters were: field of view (FOV) 50 mm, image and spectrum matrix 256 × 256, spectral bandwidth 50 kHz, readout current I r = 59.2 A. The maximum signal-to-noise ratio (SNR max ) of the noisy spectrum was equal to 200 for the "ab" spectrum (Fig. 2Ad) and to 100 for the checkerboard spectrum (Fig. 2Bd).From the "ab" spectrum in Fig. 2Ab, it can be seen that the parts of the object that are proximal to the coil transformed into the higher-frequency part of the spectrum, while the parts of the object that are distal to the coil transformed into the lower-frequency part of the spectrum.This is a consequence of the spacefrequency relation of these gradient coils (Eq.12) and also explains why the "ab" object was transformed into a spectrum by position-dependent mirroring and magnification.From the checkerboard spectrum in Fig. 2Bb, it can be well seen how the magnification of the transformation of the object into the spectrum varies and that the magnification is lower in the lower-frequency part of the spectrum and higher in the higher-frequency part of the spectrum.This also affects the reconstructed image, as parts of the object distal to the coil have lower resolution, which can be seen in Fig. 2Ac with the jagged outline of the "b" character.Images in Fig. 2Ae, Be, which were reconstructed from simulated spectra with Rician noise added in Fig. 2Ad, Dd reveal that the noise in the reconstructed image is nonuniform and is higher in the higher-resolution region of the image and lower in the lower-resolution region.
The encouraging results of the simulations in Fig. 2 were followed by imaging experiments on a checkerboard test sample, which are shown in Fig. 3 with spectra and reconstructed images and in Supplementary Fig. S2 with time-domain data.The spectrum in Fig. 3A was measured with straight wire segment nonlinear magnetic field coils and then used to reconstruct the corresponding images of the test sample (a), while the reference image in Fig. 3B was measured with conventional gradient coils and used to reconstruct the corresponding spectra (d).Regions of interest (ROIs) encircled in red and in yellow in the reconstructed images correspond to the lowerresolution (red) and higher-resolution (yellow) regions of the image.These two ROIs are enlarged in images (b) and (c) to better see the differences in resolution between them.Different models were used to reconstruct images and spectra from the measurements; the infinite straight wire model with two different readout currents was used to ensure best matching between the reconstructed and reference images in the distal (I r = 45 A, Fig. 3C) From Fig. 3C, D, it can be seen that due to inaccurate modelling of the magnetic field of the coil, the reconstructed spectra from the reference image do not match the measured spectrum at any setting of the readout current I r , and the same is true also for the reconstructed images that do not match the reference image for the same reason.In Fig. 3Cd, the reconstructed spectrum matches the measured one in the lower-frequency part, but not in the higher-frequency part, while in Fig. 3Dd, the reconstructed spectrum matches the measured one in the higher-frequency part, but not in the lower-frequency part.The accuracy of the transformation of the reference image into the spectrum also determines the accuracy of the reconstructed image from the measured spectrum.Since the spectrum in Fig. 3Cd is accurate in the lower-frequency part, the reconstructed image in Fig. 3Ca is, therefore, accurate for the region where the lower-frequency components are transformed, i.e. for the lower-resolution part of the image (red ROI).Similarly, the reconstructed image in Fig. 3Da is accurate for the region where higher-frequency components are transformed, i.e. for the higher-resolution part of the images (yellow ROI).However, the exact regions of the reconstituted images in Fig. 3Ca, Da are accurate only in size, but not in geometry.This is best seen in the enlarged higher-resolution ROIs in Fig. 3Cc, Dc where the pores are rhomboid instead of square.There is also large difference in resolution between lower-and higherresolution ROIs in Fig. 3Cb, Db, and Fig. 3Cc, Dc.The resemblance between the reconstructed image and the reference image and between the reconstructed spectrum and the measured spectrum is significantly better for the finite straight wire model in Fig. 3E.This is because this model and its parameters most accurately describe the actual magnetic field of the applied nonlinear magnetic field coil.The geometric distortion in the reconstrued image is the smallest of all three considered cases; the pores retained a square shape (Fig. 3Ec).In addition, the differences in resolution between lower-and higher-resolution ROIs in Fig. 3Eb, Ec are not as high as for the infinite straight wire model.
As a final test, the feasibility of imaging with nonlinear magnetic field coils was tested on a biological sample, i.e. carrot root, the results of which are shown in Fig. 4 and Supplementary Fig. S2.The time-domain signal in Fig. 4A and its spectrum in Fig. 4B were measured with the nonlinear magnetic field coils, while the reference image in Fig. 4D was measured with conventional gradient coils.The measured spectrum and the reference image were used to reconstruct the image in Fig. 4C and the spectrum in Fig. 4E.It can be seen that there is a great similarity between the measured and reconstructed spectra in Fig. 4B and Fig. 4E as well as between the reference and reconstructed images in Fig. 4D and Fig. 4C.The reconstructed image and spectrum match the measured references in size, geometry, and intensity.The image in Fig. 4F, which was reconstructed from the reconstructed spectrum in Fig. 4E and is practically identical to its reference in Fig. 4D, confirms the reversibility of the reconstruction algorithms used.The difference between the images in Fig. 4D and Fig. 4F is only in the resolution, which in Fig. 4F decreases with increasing distance from the coil.
Table 1 shows the results of the quantitative analysis of the image matching between the reconstructed and the corresponding reference images, given by given by the cross-correlation (CC) and the sum of squared differences (SSD) in Eq. ( 17).As can be seen from the table, the highest CC and the lowest SSD parameter were obtained in the carrot imaging experiment in Fig. 4, and the second-best result was obtained in the test sample imaging experiment in Fig. 3E.In both experiments, the images were reconstructed using the finite wire model, which is more accurate than the infinite wire model.As expected, the quantitative matching parameters were much worse for the latter model, which can also be expected from a visual inspection of the images.

Discussion
This study was motivated by a study in which the magnetic field of a straight wire was used to obtain an extremely high magnetic field gradient in the proximity of the wire, allowing precise diffusion measurements 42 .Our question was whether such an extreme "gradient" coil could also be used for MR imaging.To our knowledge, this kind of coil has not been used for imaging in any previous study of MR imaging with nonlinear magnetic fields.Most of the nonlinear coils used so far have been higher-order shim-type of coils.The straight wire segment used for the encoding coil in this study has a magnetic field gradient proportional to the negative inverse of the radial distance squared ( −1/r 2 ) and therefore diverges when approaching the wire.Moreover, this coil does not even have an isocenter.The consequences of this extreme gradient can also be seen in the measured spectrum of the test sample, which has a low magnification of the object (shrink rectangles) in the region of low magnetic field gradient and a high magnification of it (enlarged rectangles) in the region with high magnetic field gradient.Due to the signal conservation, the signal density is high (spectrum is bright) in the low magnification region, while it is low (spectrum is dark) in the high magnification region.This then also affects the SNR in the reconstructed images, which have high SNR in the low-resolution regions and low SNR in the high-resolution regions.It is also clear from the reconstructed images that some parts are without signal.This is because these regions correspond to frequencies higher than the frequencies of the acquired signal.The peculiarity of nonlinear magnetic field coils is that it is not possible to determine the gradient they generate and, consequently, neither the imaging field of view.Instead, these two parameters can be replaced by the current through the coil and the frequency bandwidth of the signal acquisition.One of the disadvantages of the nonlinear magnetic field coil used was that the encoding currents created an unbalanced torque in it.Thus, for example, a 6-mlisecond readout current of 70.8A caused active wire segment displacements of 280 µm and 360 µm in the x and y directions, respectively (Supplementary Fig. S3).This explains why the reconstructed images are slightly blurred due to motion artifacts.
Existing nonlinear magnetic field imaging theories share an unnecessarily complex reconstruction process that originates from signal interpretation in the spatial-frequency-domain (k-space).We believe that this interpretation is suboptimal, since by definition spatial frequency (k-space coordinate) should be the same for the entire sample, not just a part of it, at each encoding step.Only then can the image be reconstructed using the Fourier transform from the signals in k-space.Nonlinear magnetic field coils produce magnetic fields that have a nonconstant gradient, so k-space cannot be defined globally for the entire sample, but can only be defined locally.This leads to complex reconstruction procedures that involve solving a large set of sparse linear equations 16,17 or a nonlinear Fourier transform 21 .In this study, another solution to the problem is proposed.It is based on the understanding of the MR image as a special case of a multidimensional spectrum, i.e. the way the MR image was understood at the time of the discovery of Fourier imaging methods 6 .However, treating the MR image as a spectrum implies that the signal for the MR image is no longer a function of k (spatial frequency) but of time.For the frequency-encoding dimension, the introduction of time is quite straightforward, since the signal in this dimension is acquired as a function of time anyway.For other, higher dimensions, a pseudo time was introduced instead of the actual time.Treating the signal and its image in t-ω instead of k-r Fourier conjugate domains has an important advantage, namely the relation between the signal S( ⇀ t ) and its spectrum (distorted image) Ŝ( ⇀ ω) by the Fourier transform holds universally, i.e. also for nonlinear magnetic field coils, while this relation between the signal S( ⇀ k ) and its image ρ( ⇀ r ) only applies to conventional gradient coils, which have a constant gradient of the magnetic field they generate.
The second step of the proposed reconstruction method includes geometric and intensity correction of the distorted image (spectrum) obtained in the first reconstruction step.Geometric corrections are performed by a bijective transformation of frequency points in the spectrum into corresponding spatial points in the reconstructed image, while intensity corrections are performed by simultaneous multiplication of the intensity of the points by the Jacobian determinant of the transformation (Eq.10).This result follows from integration by substitution in Eq. ( 8).The results of the reconstructed images show how important it is to use an accurate model for the magnetic field of the encoding coils.The approximate infinite straight wire model produced distorted reconstructed images regardless of which coil current was used for the reconstruction parameter, but the reconstruction accuracy was greatly improved when the accurate finite wire model was used.In general, the magnetic field of a coil can be accurately modeled using Biot-Savart law, provided that the geometry of the encoding coil is known accurately and that other disturbing effects such as eddy currents can be excluded or modelled just as accurately.This can be very challenging, so magnetic field mapping remains an interesting alternative to modeling.There are several magnetic field mapping routines 43,44 , but they are all designed for conventional gradient coils, so the challenge remains how to accurately map the magnetic field of nonlinear magnetic field coils with the same nonlinear coils.The second step of the proposed reconstruction method given by Eq. (10), in practice can also be a source of error due to the data interpolation it implies (Supplementary Figs.S4, S5).In this step, the regular mesh of discrete points of the reconstructed image is interpolated onto the irregular mesh of spatial points transformed from the frequency-domain data (distorted image).
While the extension of the presented image reconstruction theory from 2 to 3D for MRI using nonlinear magnetic fields is quite straight forward, the complexity of nonlinear magnetic field coils for 3D imaging is generally significantly greater than for 2D imaging.For example, a logical extension of the presented nonlinear Table 1.Quantitative analysis of image matching between reconstructed and reference images given by crosscorrelation (CC) and sum of square differences (SSD).www.nature.com/scientificreports/coils for 3D imaging would be to add a third wire segment perpendicular to the first two.However, it turns out that for this set of coils, the transformation of spatial to frequency coordinates is not bijective for any of its spatial orientations.The greater complexity of the nonlinear magnetic field coils for 3D MRI together with no difference in imaging principle in 3D from 2D was the main reason why this study was performed only in 2D.
The simplest extension of this experiment would be to add a z-gradient coil to this set of nonlinear magnetic field coils, which unfortunately was not possible in this experiment due to hardware limitations.This addition would enable 2D imaging of the excited slice with the proposed method.Use of a nonlinear "z-coil" for slice selection would lead to the excitation of curved slices 34,35 , which are generally of limited practical use.As an alternative to the presented method, which may offer more possibilities to improve image quality, MRI using nonlinear gradient coils can also be considered using total variation regularization algorithms, e.g.Alternating Direction Method of Multipliers (ADMM) or ADS-POCS 45,46 .
The presented method of imaging with nonlinear pulsed magnetic fields requires the bijectivity of the encoding magnetic fields, while there are practically no other restrictions regarding the spatial dependence of these fields.This differs from the PatLoc method 15 , which is optimized to use curvilinear magnetic fields generated by an array of surface gradient coils, while parallel imaging, also used in PatLoc, solves the problem of nonbijectivity of these fields in PatLoc, making image reconstruction possible.The use of parallel imaging with our method would also alleviate the bijectivity limitation.As for the other presented imaging methods with nonlinear pulsed magnetic fields, these were mostly did not focus on the reconstruction method in general, but rather on the use of specific types of nonlinear encoding magnetic fields, e.g., in 4D-RIO 17 with a combination of linear x and y and non-linear x 2 −y 2 and 2xy fields, or in alleviation of specific problems in parallel image acquisition, e.g., in O-space imaging 27 to enhance encoding efficiency or in Null Space Imaging 25 to resolve receiver spatial encoding ambiguities.
Judging from publications, one can get the impression that the use of nonlinear magnetic field coils for spatial encoding in MRI has been out of research focus in the last decade.It can be speculated that this was in part also due to complicated reconstruction.In this study, we believe it has been clearly shown and demonstrated that this is not necessarily the case.Presented here are the necessary tools for efficient and much simpler imaging with nonlinear magnetic field coils that can have a long-term impact on development of this field.This method may allow for wider use of nonlinear magnetic field coils for signal encoding that have fewer constrains in their design.Thus, they can be optimized for specific purposes, e.g., for low inductance and thus faster imaging, for reduced acoustic noise, for installation in restricted geometries … In this this study, the encoding coil of could be of low inductance, i.e. single turn of wire design, if the used gradient amplifier could drive such low impedance loads.
In conclusion, this study demonstrates that MR imaging with highly nonlinear and divergent magnetic fields used for spatial encoding is still possible.In this study, a novel theory for imaging with nonlinear magnetic fields is presented.This is based on a two-step reconstruction process that it includes the calculation of the spectrum from the time-domain signal in the first step and the reconstruction of the image from the spectrum by bijective frequency transformation into space with intensity correction in the second step.The results of this study can facilitate the use of encoding coils with fewer constraints in their design, allowing better optimization for specific purposes.

Infinite straight wire model
One of the simplest yet highly effective coils for generating pulsed spatially variable magnetic fields is a straight wire, ideally of infinite length.Suppose that one such wire is aligned with the y-axis and another is aligned with the x-axis, while the wires cross (without having an electric contact) in the origin of the coordinate system (Fig. 5A).Nuclear precession frequencies in the vicinity of these wires are according to Eq. ( 6) and the Ampere's law equal to Using the frequency dependencies on space in Eq. ( 12) it is fairly easy to calculate the relation between the spectrum and the image according to Eq. (9)   and between the image and the spectrum according to Eq. ( 10)

Finite straight wire model
As it is practically impossible to design a coil modelling an infinite straight wire, it is more realistic to consider a model in which such a wire is replaced by a straight segment of length b − a that extends along the coordinate axis from coordinate a to coordinate b.In this model, two such perpendicular segments are considered, one along the y-axis and another along the x-axis (Fig. 5B).In this case precession frequencies of nuclei in the vicinity of such wire segments are given by ( 12) The corresponding image can be calculated from the spectrum using Eqs.(10, 15), and the needed partial derivatives for this calculation, i.e. the elements of the Jacobian determinant are equal to (15)    While it is for this model possible to calculate the image from the spectrum analytically, this is not the case for the calculation of the spectrum from the image using Eq. ( 9).This is because Eq. ( 15) cannot be inverted analytically, i.e. spatial coordinates cannot be calculated analytically from the frequencies.However, this can still be done numerically using the iterative calculation scheme described in Supplementary Fig. S6.Calculation of the Jacobian determinant in Eq. ( 9) is easier.This determinant is according to Eq. ( 11) simply reciprocal Jacobian determinant in Eq. (10).

Spatial encoding coils
Spatial encoding of the MR signal was performed with two coils in the form of rectangular wire loops, perpendicular to each other and to the static magnetic field.The frame for these coils was printed from ABS plastic using the 3D printer (Ultimaker, Utrecht, Netherlands) according to the design shown in Fig. 6A.The loops were wound into 2.8 × 2.8 mm 2 square channels running along the sides of two rectangular plates tangential to the cylinder.The dimensions of the loops measured in the center of the channel were b-a = 43.2mm and c = 117.2mm, and their radial distance to the cylinder axis was equal to r = (b + a)/2 = 25.2 mm, from where b = 46.8mm and a = 3.6 mm.Each of the coils had N = 50 turns of enameled copper wire with a diameter of 0.15 mm which corresponded to 16 m of this wire with an electrical resistance of 15 Ω for each of the coils.The coils were fixed in the channels with two-component epoxy adhesive (UHU Plus 90 min, UHU GmbH, Bühl/ Baden, Germany).The finished nonlinear magnetic field coils were integrated with existing NMR/MRI hardware as a replacement for conventional microimaging gradient coils (Fig. 6B).

Samples
The presented theory and the performance of spatial encoding coils was tested on an artificial test sample and a biological sample.Both samples were disc-shaped to allow 2D MR imaging without slice selection.The artificial test sample had a diameter of 26.6 mm and a thickness of 3 mm and it contained 52 cubic pores of size 2 × 2 × 2 mm 3 arranged in a checkerboard pattern (Fig. 6C).This sample was printed using the same plastic material and printing device as the frame for the spatial encoding coils.Before MR imaging, the pores were filled with a substance that produces an MR signal, i.e. 2% agar gel to which 0.05% copper sulfate was added, thus reducing the relaxation times of the gel to T 1 = 460 ms and T 2 = 350 ms (Fig. 6D).The biological sample was a carrot root, from which a 5 mm axial slice was cut from its section with a diameter of approximately 25 mm.The slice was then inserted and capped in a 27 mm round Teflon vial to prevent its desiccation during imaging.

Magnetic resonance imaging
The sample, either test or biological, was first inserted into a 27 mm diameter 100 MHz radiofrequency (RF) transmit/receive coil, surrounded by microimaging gradient coils or by their nonlinear magnetic field alternative, inside the main magnet.MR imaging of the test sample was then performed using a spin-echo imaging sequence (Fig. 1), first with conventional gradient coils and then with nonlinear magnetic field coils.In the case of imaging with conventional gradient coils, the imaging parameters were as follows: field of view (FOV) 50 mm, readout gradient (G r ) 23.5 mT/m, phase gradient amplitude (G p_max ) 20 mT/m, phase gradient pulse duration (t p ) 3 ms, matrix (M × M) 256 × 256, dwell time (Δt 1 ) 20 μs, acquisition frequency bandwidth (BW 1 ) 50 kHz, repetition time (TR) 530 ms, echo time (TE) 26 ms, signal averages 10 and scan time 23 min.These parameters were also the same in the case of imaging with nonlinear magnetic field coils, except for readout current (I r ) 70.8 A and phase current amplitude ( I p_ max = M 2 I p ) 60.4 A. The latter was determined using BW 2 = BW 1 , from which follows Δt 2 = 20 μs and �I p = I r �t 2 /t p = 0.47 A according to Eq. (6).Note that the actual currents through the readout and phase-encoding coils were equal to I r /N = 1.42A and I p_max /N = 1.21A due to N turns of wire in each these two coils, and that these currents can be for nonlinear magnetic field coils treated as parameters replacing the gradient amplitudes of conventional gradient coils.MR imaging using both types of spatial encoding coils, nonlinear and linear (gradient), was performed using standard other MRI hardware consisted of a superconducting 2.35 T horizontal-bore high-resolution NMR magnet (Oxford Instruments, Abingdon, UK), a digital NMR/MRI spectrometer (Tecmag, Houston TX, USA) and RF and gradient accessories for MR microscopy (Bruker, Ettlingen, Germany).Since the resistance of the nonlinear magnetic field coils was greater than that of the gradient coils, it was possible to drive them with the existing gradient amplifiers without any modifications.

Image processing
The acquired MR image signals in time-domain were Fourier transformed into their multidimensional spectra using the TNMR signal acquisition and processing software (Tecmag, Houston TX, USA).The other processing steps required to reconstruct the undistorted images of the samples were implemented as macro programs for

Figure 2 .
Figure 2. Simulation of imaging with nonlinear magnetic field coils.(A) characters "ab" and (B) checkerboard (a) object was used to simulate (b) the expected 2D spectrum, which was then used to reconstruct (c) the image.This process was repeated with (d) the noised spectrum, yielding (e) the noised reconstructed image.This simulation was performed using an infinite wire model for coils with a nonlinear magnetic field.

Figure 3 .
Figure 3. Reconstructed images and spectra from test sample measurements.(A) The measured spectrum and (B) the reference image of the test sample were used to reconstruct the corresponding (a) images and (d) spectra using the infinite wire model at (C) I r = 45 A and (D) I r = 70 A and the finite wire model at (E) I r = 80 A, a = 3.6 mm and b = 46.8mm.Magnified (b) low-and (d) high-resolution images of selected regions of interest (ROIs).

Figure 4 .
Figure 4. Measured and reconstructed images and spectra of a carrot root.A 5 mm thick slice across a carrot root was imaged with nonlinear magnetic field coils to obtain (A) the measured raw (time-domain) data (B) the measured spectrum from which (C) the corresponding image was reconstructed.The measurement was repeated with conventional gradient coils to obtain (D) the reference image and calculate (E) the corresponding spectrum.This was then used to simulate (F) the reconstructed image.

Figure 5 .
Figure 5. Models of nonlinear magnetic field coils and their corresponding simulated magnetic field maps B 1 = ω 1 /γ and B 2 = ω 2 /γ .The feasibility of imaging with nonlinear magnetic field coils was tested with (A) infinite and (B) finite straight wire models.The magnetic fields were calculated using Eqs.(12, 15) for parameters I r = 80 A, a = 3.6 mm and b = 46.8mm.They are shown in a region of 50 × 50 mm 2 with the origin at x = 0 and y = 0.

4πx 2 (4πy 2 (Figure 6 .
Figure 6.Nonlinear magnetic field coils and the test sample.(A) Model of the frame for nonlinear magnetic field coils and (B) the finished coils, each made of 50 turns of enameled copper wire wound on the 3D printed plastic frame.The coils in the image are already installed in the NMR probe holder with the RF probe being in the middle.(C) Model for the test sample in a form of a disc with 2 × 2 × 2 mm 3 cubic pores arranged in a checkerboard pattern and (D) the test sample before installation in the RF probe with pores filled with 2% agar gel.